import json

json_data = '{"data":{"userAuth":{"reserve":{"libs":[{"lib_id":10073,"lib_floor":"2楼","is_open":true,' \
            '"lib_name":"郑东校区-2楼西阅览区","lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":212,' \
            '"seats_used":118,"seats_booking":4,"seats_has":90,"reserve_ttl":1800,"open_time":1702596600,' \
            '"open_time_str":" 7:30","close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},' \
            '{"lib_id":10065,"lib_floor":"2楼","is_open":true,"lib_name":"郑东校区-2楼东阅览区","lib_type":0,"lib_group_id":0,' \
            '"lib_comment":"","lib_rt":{"seats_total":228,"seats_used":142,"seats_booking":3,"seats_has":83,' \
            '"reserve_ttl":1800,"open_time":1702596600,"open_time_str":" 7:30","close_time":"1702650600",' \
            '"close_time_str":" 22:30","advance_booking":"1小时"}},{"lib_id":10071,"lib_floor":"2楼","is_open":true,' \
            '"lib_name":"郑东校区-2楼东电子阅览区","lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":62,' \
            '"seats_used":62,"seats_booking":0,"seats_has":0,"reserve_ttl":1800,"open_time":1702596600,' \
            '"open_time_str":" 7:30","close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},' \
            '{"lib_id":10072,"lib_floor":"2楼","is_open":true,"lib_name":"郑东校区-2楼西电子阅览区","lib_type":0,' \
            '"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":62,"seats_used":62,"seats_booking":0,' \
            '"seats_has":0,"reserve_ttl":1800,"open_time":1702596600,"open_time_str":" 7:30",' \
            '"close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},{"lib_id":11447,' \
            '"lib_floor":"2楼","is_open":false,"lib_name":"文北校区-2楼基藏书阅览室","lib_type":0,"lib_group_id":0,' \
            '"lib_comment":"","lib_rt":{"seats_total":265,"seats_used":0,"seats_booking":0,"seats_has":265,' \
            '"reserve_ttl":1800,"open_time":1702684800,"open_time_str":"明天 8:00","close_time":"1702698300",' \
            '"close_time_str":"明天 11:45","advance_booking":"1小时"}},{"lib_id":11451,"lib_floor":"2楼","is_open":true,' \
            '"lib_name":"文北校区-2楼基藏书阅览室下午","lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":265,' \
            '"seats_used":0,"seats_booking":0,"seats_has":265,"reserve_ttl":1800,"open_time":1702616400,' \
            '"open_time_str":" 13:00","close_time":"1702647000","close_time_str":" 21:30",' \
            '"advance_booking":"1.16小时"}},{"lib_id":10080,"lib_floor":"3楼","is_open":true,"lib_name":"郑东校区-3楼西电子阅览区",' \
            '"lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":36,"seats_used":35,' \
            '"seats_booking":1,"seats_has":0,"reserve_ttl":1800,"open_time":1702596600,"open_time_str":" 7:30",' \
            '"close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},{"lib_id":10081,' \
            '"lib_floor":"3楼","is_open":true,"lib_name":"郑东校区-3楼东电子阅览区","lib_type":0,"lib_group_id":0,' \
            '"lib_comment":"","lib_rt":{"seats_total":36,"seats_used":36,"seats_booking":0,"seats_has":0,' \
            '"reserve_ttl":1800,"open_time":1702596600,"open_time_str":" 7:30","close_time":"1702650600",' \
            '"close_time_str":" 22:30","advance_booking":"1小时"}},{"lib_id":10082,"lib_floor":"3楼","is_open":true,' \
            '"lib_name":"郑东校区-3楼东阅览区","lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":232,' \
            '"seats_used":127,"seats_booking":0,"seats_has":105,"reserve_ttl":1800,"open_time":1702596600,' \
            '"open_time_str":" 7:30","close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},' \
            '{"lib_id":10083,"lib_floor":"3楼","is_open":true,"lib_name":"郑东校区-3楼西阅览区","lib_type":0,"lib_group_id":0,' \
            '"lib_comment":"","lib_rt":{"seats_total":232,"seats_used":136,"seats_booking":1,"seats_has":95,' \
            '"reserve_ttl":1800,"open_time":1702596600,"open_time_str":" 7:30","close_time":"1702650600",' \
            '"close_time_str":" 22:30","advance_booking":"1小时"}},{"lib_id":10084,"lib_floor":"3楼","is_open":true,' \
            '"lib_name":"郑东校区-3楼中阅览区","lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":130,' \
            '"seats_used":97,"seats_booking":1,"seats_has":32,"reserve_ttl":1800,"open_time":1702596600,' \
            '"open_time_str":" 7:30","close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},' \
            '{"lib_id":11449,"lib_floor":"3楼","is_open":false,"lib_name":"文北校区-3楼综合阅览室","lib_type":0,' \
            '"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":336,"seats_used":0,"seats_booking":0,' \
            '"seats_has":336,"reserve_ttl":1800,"open_time":1702684800,"open_time_str":"明天 8:00",' \
            '"close_time":"1702698300","close_time_str":"明天 11:45","advance_booking":"1小时"}},{"lib_id":11450,' \
            '"lib_floor":"3楼","is_open":true,"lib_name":"文北校区-3楼综合阅览室下午","lib_type":0,"lib_group_id":0,' \
            '"lib_comment":"","lib_rt":{"seats_total":336,"seats_used":0,"seats_booking":0,"seats_has":336,' \
            '"reserve_ttl":1800,"open_time":1702616400,"open_time_str":" 13:00","close_time":"1702647000",' \
            '"close_time_str":" 21:30","advance_booking":"1.16小时"}},{"lib_id":10085,"lib_floor":"4楼","is_open":true,' \
            '"lib_name":"郑东校区-4楼西电子阅览区","lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":28,' \
            '"seats_used":28,"seats_booking":0,"seats_has":0,"reserve_ttl":1800,"open_time":1702596600,' \
            '"open_time_str":" 7:30","close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},' \
            '{"lib_id":10086,"lib_floor":"4楼","is_open":true,"lib_name":"郑东校区-4楼东电子阅览区","lib_type":0,' \
            '"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":28,"seats_used":28,"seats_booking":0,' \
            '"seats_has":0,"reserve_ttl":1800,"open_time":1702596600,"open_time_str":" 7:30",' \
            '"close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},{"lib_id":10087,' \
            '"lib_floor":"4楼","is_open":true,"lib_name":"郑东校区-4楼西阅览区","lib_type":0,"lib_group_id":0,"lib_comment":"",' \
            '"lib_rt":{"seats_total":80,"seats_used":74,"seats_booking":3,"seats_has":3,"reserve_ttl":1800,' \
            '"open_time":1702596600,"open_time_str":" 7:30","close_time":"1702650600","close_time_str":" 22:30",' \
            '"advance_booking":"1小时"}},{"lib_id":10088,"lib_floor":"4楼","is_open":true,"lib_name":"郑东校区-4楼东阅览区",' \
            '"lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":80,"seats_used":76,' \
            '"seats_booking":0,"seats_has":4,"reserve_ttl":1800,"open_time":1702596600,"open_time_str":" 7:30",' \
            '"close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},{"lib_id":10089,' \
            '"lib_floor":"4楼","is_open":true,"lib_name":"郑东校区-4楼中阅览区","lib_type":0,"lib_group_id":0,"lib_comment":"",' \
            '"lib_rt":{"seats_total":128,"seats_used":115,"seats_booking":0,"seats_has":13,"reserve_ttl":1800,' \
            '"open_time":1702596600,"open_time_str":" 7:30","close_time":"1702650600","close_time_str":" 22:30",' \
            '"advance_booking":"1小时"}},{"lib_id":10090,"lib_floor":"5楼","is_open":true,"lib_name":"郑东校区-5楼西阅览区",' \
            '"lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":102,"seats_used":71,' \
            '"seats_booking":0,"seats_has":31,"reserve_ttl":1800,"open_time":1702596600,"open_time_str":" 7:30",' \
            '"close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},{"lib_id":10091,' \
            '"lib_floor":"5楼","is_open":true,"lib_name":"郑东校区-5楼东阅览区","lib_type":0,"lib_group_id":0,"lib_comment":"",' \
            '"lib_rt":{"seats_total":102,"seats_used":64,"seats_booking":0,"seats_has":38,"reserve_ttl":1800,' \
            '"open_time":1702596600,"open_time_str":" 7:30","close_time":"1702650600","close_time_str":" 22:30",' \
            '"advance_booking":"1小时"}},{"lib_id":10092,"lib_floor":"5楼","is_open":true,"lib_name":"郑东校区-5楼中阅览区",' \
            '"lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":196,"seats_used":164,' \
            '"seats_booking":5,"seats_has":27,"reserve_ttl":1800,"open_time":1702596600,"open_time_str":" 7:30",' \
            '"close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},{"lib_id":11019,' \
            '"lib_floor":"6楼","is_open":true,"lib_name":"郑东校区-6楼西阅览区","lib_type":0,"lib_group_id":0,"lib_comment":"",' \
            '"lib_rt":{"seats_total":80,"seats_used":79,"seats_booking":1,"seats_has":0,"reserve_ttl":1800,' \
            '"open_time":1702596600,"open_time_str":" 7:30","close_time":"1702650600","close_time_str":" 22:30",' \
            '"advance_booking":"1小时"}},{"lib_id":11033,"lib_floor":"6楼","is_open":true,"lib_name":"郑东校区-6楼中阅览区",' \
            '"lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":80,"seats_used":40,' \
            '"seats_booking":2,"seats_has":38,"reserve_ttl":1800,"open_time":1702596600,"open_time_str":" 7:30",' \
            '"close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},{"lib_id":11040,' \
            '"lib_floor":"6楼","is_open":true,"lib_name":"郑东校区-6楼东阅览区","lib_type":0,"lib_group_id":0,"lib_comment":"",' \
            '"lib_rt":{"seats_total":80,"seats_used":79,"seats_booking":1,"seats_has":0,"reserve_ttl":1800,' \
            '"open_time":1702596600,"open_time_str":" 7:30","close_time":"1702650600","close_time_str":" 22:30",' \
            '"advance_booking":"1小时"}},{"lib_id":11300,"lib_floor":"6楼","is_open":true,"lib_name":"郑东校区-6楼北阅览区",' \
            '"lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":110,"seats_used":32,' \
            '"seats_booking":0,"seats_has":78,"reserve_ttl":1800,"open_time":1702596600,"open_time_str":" 7:30",' \
            '"close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},{"lib_id":11054,' \
            '"lib_floor":"7楼","is_open":true,"lib_name":"郑东校区-7楼西阅览区","lib_type":0,"lib_group_id":0,"lib_comment":"",' \
            '"lib_rt":{"seats_total":96,"seats_used":68,"seats_booking":0,"seats_has":28,"reserve_ttl":1800,' \
            '"open_time":1702596600,"open_time_str":" 7:30","close_time":"1702650600","close_time_str":" 22:30",' \
            '"advance_booking":"1小时"}},{"lib_id":11061,"lib_floor":"7楼","is_open":true,"lib_name":"郑东校区-7楼中阅览区",' \
            '"lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":142,"seats_used":98,' \
            '"seats_booking":1,"seats_has":43,"reserve_ttl":1800,"open_time":1702596600,"open_time_str":" 7:30",' \
            '"close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},{"lib_id":11068,' \
            '"lib_floor":"7楼","is_open":true,"lib_name":"郑东校区-7楼东阅览区","lib_type":0,"lib_group_id":0,"lib_comment":"",' \
            '"lib_rt":{"seats_total":96,"seats_used":56,"seats_booking":2,"seats_has":38,"reserve_ttl":1800,' \
            '"open_time":1702596600,"open_time_str":" 7:30","close_time":"1702650600","close_time_str":" 22:30",' \
            '"advance_booking":"1小时"}},{"lib_id":11075,"lib_floor":"8楼","is_open":true,"lib_name":"郑东校区-8楼电子西阅览区",' \
            '"lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":28,"seats_used":28,' \
            '"seats_booking":0,"seats_has":0,"reserve_ttl":1800,"open_time":1702596600,"open_time_str":" 7:30",' \
            '"close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},{"lib_id":11096,' \
            '"lib_floor":"8楼","is_open":true,"lib_name":"郑东校区-8楼东阅览区","lib_type":0,"lib_group_id":0,"lib_comment":"",' \
            '"lib_rt":{"seats_total":80,"seats_used":80,"seats_booking":0,"seats_has":0,"reserve_ttl":1800,' \
            '"open_time":1702596600,"open_time_str":" 7:30","close_time":"1702650600","close_time_str":" 22:30",' \
            '"advance_booking":"1小时"}},{"lib_id":11117,"lib_floor":"8楼","is_open":true,"lib_name":"郑东校区-8楼西阅览区",' \
            '"lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":80,"seats_used":79,' \
            '"seats_booking":1,"seats_has":0,"reserve_ttl":1800,"open_time":1702596600,"open_time_str":" 7:30",' \
            '"close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},{"lib_id":11131,' \
            '"lib_floor":"8楼","is_open":true,"lib_name":"郑东校区-8楼中阅览室","lib_type":0,"lib_group_id":0,"lib_comment":"",' \
            '"lib_rt":{"seats_total":108,"seats_used":81,"seats_booking":0,"seats_has":27,"reserve_ttl":1800,' \
            '"open_time":1702596600,"open_time_str":" 7:30","close_time":"1702650600","close_time_str":" 22:30",' \
            '"advance_booking":"1小时"}},{"lib_id":11138,"lib_floor":"8楼","is_open":true,"lib_name":"郑东校区-8楼电子东阅览区",' \
            '"lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":28,"seats_used":28,' \
            '"seats_booking":0,"seats_has":0,"reserve_ttl":1800,"open_time":1702596600,"open_time_str":" 7:30",' \
            '"close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},{"lib_id":11082,' \
            '"lib_floor":"9楼","is_open":true,"lib_name":"郑东校区-9楼西阅览区","lib_type":0,"lib_group_id":0,"lib_comment":"",' \
            '"lib_rt":{"seats_total":97,"seats_used":57,"seats_booking":1,"seats_has":39,"reserve_ttl":1800,' \
            '"open_time":1702596600,"open_time_str":" 7:30","close_time":"1702650600","close_time_str":" 22:30",' \
            '"advance_booking":"1小时"}},{"lib_id":11103,"lib_floor":"9楼","is_open":true,"lib_name":"郑东校区-9楼中阅览区",' \
            '"lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":188,"seats_used":127,' \
            '"seats_booking":1,"seats_has":60,"reserve_ttl":1800,"open_time":1702596600,"open_time_str":" 7:30",' \
            '"close_time":"1702650600","close_time_str":" 22:30","advance_booking":"1小时"}},{"lib_id":11124,' \
            '"lib_floor":"9楼","is_open":true,"lib_name":"郑东校区-9楼东阅览区","lib_type":0,"lib_group_id":0,"lib_comment":"",' \
            '"lib_rt":{"seats_total":97,"seats_used":57,"seats_booking":1,"seats_has":39,"reserve_ttl":1800,' \
            '"open_time":1702596600,"open_time_str":" 7:30","close_time":"1702650600","close_time_str":" 22:30",' \
            '"advance_booking":"1小时"}},{"lib_id":11748,"lib_floor":"2楼","is_open":false,"lib_name":"文北校区-2楼自主学习室",' \
            '"lib_type":0,"lib_group_id":0,"lib_comment":"","lib_rt":{"seats_total":48,"seats_used":0,' \
            '"seats_booking":0,"seats_has":48,"reserve_ttl":1800,"open_time":1702684800,"open_time_str":"明天 8:00",' \
            '"close_time":"1702698300","close_time_str":"明天 11:45","advance_booking":"1小时"}}],"libGroups":[{' \
            '"id":1276,"group_name":"郑东校区"},{"id":1283,"group_name":"文北校区上午开放"},{"id":1290,' \
            '"group_name":"文北校区下午晚上开放"}],"reserve":null},"record":{"libs":[]},"rule":{"signRule":""}}}}'

data = json.loads(json_data)

lib_name_id_map = {}

libs = data['data']['userAuth']['reserve']['libs']

for lib in libs:
    lib_name_id_map[lib['lib_name']] = lib['lib_id']

# Writing to a text file
with open('lib_names_and_ids.txt', 'w') as file:
    for lib_name, lib_id in lib_name_id_map.items():
        file.write(f"{lib_name}: {lib_id}\n")

print("Data written to 'lib_names_and_ids.txt' file.")
